#ifndef Point3D_h
#define Point3D_h

#include <ostream>

/**
 * Classe Point3D
 */
class Point3D
{

   friend std::ostream & operator<<(std::ostream & out, const Point3D & _point3D)
      {
         out << "(" << _point3D.x() << ", " << _point3D.y() << ", " << _point3D.z() << ")";
         return out;
      }

  public:
   Point3D(float _x=0, float _y=0, float _z=0) { coords[0]=_x; coords[1]=_y; coords[2]=_z; }
   float x() const { return coords[0]; }
   float y() const { return coords[1]; }
   float z() const { return coords[2]; }

   void setX(float _x) { coords[0]=_x; }   
   void setY(float _y) { coords[1]=_y; }
   void setZ(float _z) { coords[2]=_z; }

   Point3D & operator=(const Point3D _point3D)
      {
         coords[0] = _point3D.x();
         coords[1] = _point3D.y();
         coords[2] = _point3D.z();
         return *this;
      }

   operator const double *()
   {
      return coords;
   }

   bool operator==(const Point3D _point3D) const 
      {
         return( coords[0] == _point3D.x() && coords[1] == _point3D.y() && coords[2] == _point3D.z() );
      }

   bool operator!=(const Point3D _point3D) const 
      {
         return( coords[0] != _point3D.x() || coords[1] != _point3D.y() || coords[2] != _point3D.z() );
      }

  protected:
   double coords[3];

};

#endif
